package drone.basis.util ;

import org.apache.commons.codec.digest.DigestUtils ;

public class DigestUtil
{

	public static String md5 (
			String text
	)
	{
		if ( StringUtil.isEmpty ( text ) )
		{
			return "" ;
		}
		return DigestUtils.md5Hex ( text ) ;
	}

	public static String sha256 (
			String text
	)
	{
		if ( StringUtil.isEmpty ( text ) )
		{
			return "" ;
		}
		return DigestUtils.sha256Hex ( text ) ;
	}

	public static void main (
			String [ ] args
	) throws Exception
	{
		System.out.println ( md5 ( "123123" ) ) ;
		System.out.println ( sha256 ( "123123" ) ) ;
	}
}
